-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multilayerperceptron example added with seaborndataset #51
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have already gradle wrapper. Delete this file.
* Knn - K nearest neighbors | ||
* Dataset: Seaborn Penguins | ||
*/ | ||
public class MultilayerPerceptronExample2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this to MultilayerPerceptronSeabornExample
Also Rename the old MultilayerPerceptronExample class to MultilayerPerceptronIrisExample
|
||
NetworkConfiguration networkConfiguration = new NetworkConfiguration(seabornProvider.getTrainFeatures()[0].length, List.of(32, 6), 3, 0.01, 1000, ActivationFunction.LEAKY_RELU, ActivationFunction.SOFTMAX, LossFunction.CATEGORICAL_CROSS_ENTROPY, Initialization.XAVIER, Initialization.XAVIER); | ||
|
||
MultilayerPerceptron multilayerPerceptron = new MultilayerPerceptron(networkConfiguration, testFeatures, testLabels); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have unified Interface for all classifiers. Replace datatype here with
Classifier multilayerPerceptron = ...
import de.edux.functions.activation.ActivationFunction; | ||
import de.edux.functions.initialization.Initialization; | ||
import de.edux.functions.loss.LossFunction; | ||
import de.edux.ml.knn.KnnClassifier; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this import
NetworkConfiguration networkConfiguration = new NetworkConfiguration(seabornProvider.getTrainFeatures()[0].length, List.of(32, 6), 3, 0.01, 1000, ActivationFunction.LEAKY_RELU, ActivationFunction.SOFTMAX, LossFunction.CATEGORICAL_CROSS_ENTROPY, Initialization.XAVIER, Initialization.XAVIER); | ||
|
||
MultilayerPerceptron multilayerPerceptron = new MultilayerPerceptron(networkConfiguration, testFeatures, testLabels); | ||
multilayerPerceptron.train(seabornProvider.getTrainFeatures(), labels); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You defined already double[][] features = seabornProvider.getTrainFeatures();
Replace your seabornProvider.getTrainFeatures() call here, with variable features
import java.util.List; | ||
|
||
/** | ||
* Knn - K nearest neighbors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this copy pasted part. Wrong JavaDoc here.
No description provided.